<?php $this->_extends('_layouts/main_layout'); ?>
<?php $this->_block('title'); ?>
<?php echo "Add Site"; ?>
<?php $this->_endblock(); ?>

<?php $this->_block('contents'); ?>
<div id="content" class="box">
	<h1>Add Site</h1>
		<?php if (isset($infos)) 
				{
					foreach ($infos as $info)
					{
		?>
				<p class="msg info"><?php echo $info;?></p>
		<?php		}
				}
		?>
		<fieldset>
			<legend>Add Site</legend>
		<?php if (isset($errors)) 
				{
					foreach ($errors as $error)
					{
		?>
				<p class="msg error"><?php echo $error;?></p>
		<?php		}
				}
		?>
		<form method="post" action="<?php echo url('site/add');?>">
		<table class="nostyle">
			<tr>
				<td>Name:</td>
				<td><input type="text" class="input-text" name="name" value="<?php echo isset($name) ? $name : '';?>"/></td>
			</tr>
			<tr>
				<td>Domain:</td>
				<td><input type="text" class="input-text" name="domain" value="<?php echo isset($domain) ? $domain : '';?>"/></td>
			</tr>
			<tr>
				<td>Game:</td>
				<td>
					<select name="game">
						<option value="">--Choose a Game Type--</option>
						<option value="1" <?php echo ('1' == $game) ?  'selected="selected"' : ''; ?>>slot</option>
						<option value="2" <?php echo ('2' == $game) ?  'selected="selected"' : ''; ?>>wheel</option>
						<option value="3" <?php echo ('3' == $game) ?  'selected="selected"' : ''; ?>>poker</option>
					</select>
				</td>
			</tr>
			<tr>
				<td>Jackpot</td>
				<td><input type="text" name="jackpot" value="<?php echo isset($jackpot) ? $jackpot : '';?>" /></td>
			</tr>
			<tr>
				<td>Jackpot Percent:</td>
				<td><input type="text" name="jackpot_percent" value="<?php echo isset($jackpot_percent) ? $jackpot_percent : '';?>" /></td>
			</tr>
			<tr>
				<td>Template:</td>
				<td>
					<?php 
						echo Util::buildDropDownList(
						 	array('id'=>'template', 'name'=>'template'),
						 	$templates,
						 	isset($template) ? $template: false
						 );
					?>
				</td>
			</tr>
			<tr>
				<td>Monetization1:</td>
				<td>
					<?php
						 echo Util::buildDropDownList(
						 	array('id'=>'monetization1', 'name'=>'monetization1'),
						 	$monetizations,
						 	isset($monetization1) ? $monetization1: false,
						 	array('k'=>'', 'l'=>'--All--')
						 );
					?>
				</td>
			</tr>
			<tr>
				<td>Monetization2:</td>
				<td>
					<?php
					 echo Util::buildDropDownList(
					 	array('id'=>'monetization2', 'name'=>'monetization2'),
					 	$monetizations,
					 	isset($monetization2) ? $monetization2: false,
					 	array('k'=>'', 'l'=>'--All--')
					 );
					?>
				</td>
			</tr>
			<tr>
				<td>Monetization3:</td>
				<td>
					<?php
					 echo Util::buildDropDownList(
					 	array('id'=>'monetization3', 'name'=>'monetization3'),
					 	$monetizations,
					 	isset($monetization3) ? $monetization3: false,
					 	array('k'=>'', 'l'=>'--All--')
					 );
					?>
				</td>
			</tr>
			<tr>
				<td>Monetization4:</td>
				<td>
					<?php
					 echo Util::buildDropDownList(
					 	array('id'=>'monetization4', 'name'=>'monetization4'),
					 	$monetizations,
					 	isset($monetization4) ? $monetization4: false,
					 	array('k'=>'', 'l'=>'--All--')
					 );
					?>
				</td>
			</tr>
			<tr>
				<td>Top Ad Url:</td>
				<td><textarea rows="2" cols="40" name="ad_top"><?php echo isset($ad_top) ? $ad_top : '';?></textarea></td>
			</tr>
			<tr>
				<td>Right Ad Url:</td>
				<td><textarea rows="2" cols="40" name="ad_right"><?php echo isset($ad_right) ? $ad_right : '';?></textarea></td>
			</tr>
			<tr>
				<td>Bottom Ad Url:</td>
				<td><textarea rows="2" cols="40" name="ad_bottom"><?php echo isset($ad_bottom) ? $ad_bottom : '';?></textarea></td>
			</tr>
			<tr>
				<td>p5:</td>
				<td><input type="text" name="p5" value="<?php echo isset($p5) ? $p5 : ''; ?>"/></td>
			</tr>
			<tr>
				<td>p10:</td>
				<td><input type="text" name="p10" value="<?php echo isset($p10) ? $p10 : ''; ?>"/></td>
			</tr>
			<tr>
				<td>p15:</td>
				<td><input type="text" name="p15" value="<?php echo isset($p15) ? $p15 : ''; ?>"/></td>
			</tr>
			<tr>
				<td>p20:</td>
				<td><input type="text" name="p20" value="<?php echo isset($p20) ? $p20 : ''; ?>"/></td>
			</tr>
			<tr>
				<td>p25:</td>
				<td><input type="text" name="p25" value="<?php echo isset($p25) ? $p25 : ''; ?>"/></td>
			</tr>
			<tr>
				<td>p30:</td>
				<td><input type="text" name="p30" value="<?php echo isset($p30) ? $p30 : ''; ?>"/></td>
			</tr>
			<tr>
				<td>p35:</td>
				<td><input type="text" name="p35" value="<?php echo isset($p35) ? $p35 : ''; ?>"/></td>
			</tr>
			<tr>
				<td>p40:</td>
				<td><input type="text" name="p40" value="<?php echo isset($p40) ? $p40 : ''; ?>"/></td>
			</tr>
			<tr>
				<td>p45:</td>
				<td><input type="text" name="p45" value="<?php echo isset($p45) ? $p45 : ''; ?>"/></td>
			</tr>
			<tr>
				<td>p50:</td>
				<td><input type="text" name="p50" value="<?php echo isset($p50) ? $p50 : ''; ?>"/></td>
			</tr>
			<tr>
				<td>Locale:</td>
				<td>
					<select name="locale">
						<option <?php echo (isset($locale)&&'US'==$locale) ? 'selected="selected"' : '';?>">US</option>
						<option <?php echo (isset($locale)&&'UK'==$locale) ? 'selected="selected"' : '';?>">UK</option>
					</select>
				</td>
			</tr>
			<tr>
				<td>Keywords:</td>
				<td><textarea rows="5" cols="40" class="input-text" name="keywords"><?php echo isset($keywords) ? htmlentities($keywords) : '';?></textarea></td>
			</tr>
			<tr>
				<td>Description:</td>
				<td><textarea rows="10" cols="40" class="input-text" name="description"><?php echo isset($description) ? htmlentities($description) : '';?></textarea></td>
			</tr>
			<tr>
				<td colspan="2" class="t-right"><input type="submit" class="input-submit" value="Save"/></td>
			</tr>
		</table>
		</form>
	</fieldset>
</div>
<?php $this->_endblock(); ?>
